FROM zhilink/ubuntu:14.04.1
MAINTAINER hardyxia <1009254417@qq.com>
ENV REFRESHED_AT 2016-12-16

COPY sources.list /etc/apt/sources.list

ADD openresty-1.11.2.2.tar.gz / 

RUN apt-get -y update \
    && apt-get install -y vim  wget lsof openssh-server openssh-client libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl     make \ 
    && cd openresty-1.11.2.2 && ./configure --with-luajit && make && make install \
    && cp  /usr/local/openresty/nginx/sbin/nginx  /usr/sbin/ \
#    && echo "\ndaemon off;" >> /usr/local/openresty/nginx/conf/nginx.conf \
    && rm -rf /openresty-1.11.2.2  \
    &&  nginx -t \
    && apt-get clean 


COPY nginx /etc/init.d/nginx 
RUN chmod +x /etc/init.d/nginx 
ADD start.sh /start.sh 

#CMD /usr/sbin/nginx
CMD ["/start.sh"]


